#ifndef _GOVT_CRAFT_HPP_
#define _GOVT_CRAFT_HPP_

/*******************************************************************************
 ** Government Sanctioned Espionage RPG Server                                **
 ** http://www.government-sanctioned.us/                                      **
 **===========================================================================**
 ** Name: craft.hpp                                                           **
 ** Description: Crafting support.                                            **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/GOVT/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 ** Copyright (c) 2009-2012  Open Design Strategies, LLC                      **
 ** All rights reserved.                                                      **
 ******************************************************************************/
// $HeadURL$
// Modified $Date$ by $Author$
// $Id$

enum class CraftingComponentRarity
{
	common, uncommon, seldom, rare,
	scarce, collectors
};

#pragma db object table("crafting_specialty")
class CraftingSpecialty
{
public:
	CraftingSpecialty() { }

	std::string & Name() const { return idcrafting_specialty_; }
	void Name(const std::string & n) { idcrafting_specialty_ = n; }
	std::string & Instruction() const { return instruction_; }
	void Instruction(const std::string & i) { instruction_ = i; }

private:
	friend class odb::access;

	#pragma db id
	std::string	idcrafting_specialty_;
	std::string	instruction_;
};

#pragma db value table("crafting_component_type")
class CraftingComponentType
{
public:
	CraftingComponentType() { }

	std::string & Name() const { return idcrafting_component_type_; }
	void Name(const std::string & n) { idcrafting_component_type_ = n; }

private:
	friend class odb::access;

	#pragma db id
	std::string	idcrafting_component_type_;
};

#pragma db object table("crafting_component")
class CraftingComponent
{
public:
	CraftingComponent() { }

private:
	friend class odb::access;

	#pragma db id auto
	entity_t	idcrafting_component_;
	std::string	name_;
	double		quality_;
	std::string	used_in_;
	CraftingComponentType	type_;
	CraftingComponentRarity	rarity_;
	CraftingSpecialty	specialty_;
};

#pragma db object table("crafting_instruction")
class CraftingInstruction
{
public:

private:
	friend class odb::access;

#pragma db id auto
	entity_t	id_;
	std::string	name_;
	entity_t	builds_;
	std::vector<entity_t> components_;
};

// TODO the functions/classes that actually craft an object/item.

#endif /* _GOVT_CRAFT_HPP_ */
